import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { Routes, RouterModule } from '@angular/router';
import { NgZorroIopModule } from 'ng-zorro-iop';
import { NgZorroAntdModule } from 'ng-zorro-antd';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { NgxEchartsModule } from "ngx-echarts";
import { SharedComponentModule } from "../../shared-component/shared-component.module";
import { FunctionListComponent } from './list/function-list.component';
import { FunctionCreateComponent } from './create/function-create.component';
import { FunctionDetailComponent } from './detail/function-detail.component';
import { FunctionLogComponent } from './detail/log/function-log.component';
import { FunctionLayerComponent } from './detail/layer/function-layer.component';
import { FunctionMonitorComponent } from './detail/monitor/function-monitor.component';
import { FunctionCodeComponent } from './detail/code/function-code.component';
import { FunctionTriggerComponent } from './detail/function-trigger/function-trigger.component';
import { NetConfigComponent } from './detail/net-config/net-config.component';
import { CodeService } from "../../service/code.service";
import { MonacoEditorModule } from "ngx-monaco-editor";
import { NzPopoverModule } from 'ng-zorro-antd/popover';
import { AliasCreateComponent } from './detail/alias/alias-create/alias-create.component';
import { AliasDeleteComponent } from './detail/alias/alias-delete/alias-delete.component';
import { NzInputNumberModule } from 'ng-zorro-antd/input-number';
import { ClipboardModule } from 'ngx-clipboard';
import { HttpInvokeComponent } from './detail/http-invoke/http-invoke.component';

const FC_ROUTES: Routes = [
  {
    path: '',
    component: FunctionListComponent,
    data: {
      breadcrumb: '函数列表',
      hasRegion: true
    }
  },
  {
    path: 'create',
    component: FunctionCreateComponent,
    data: {
      breadcrumb: '创建函数',
      hasRegion: false
    }
  },
  {
    path: 'detail/:groupId/:functionId/:versionName',
    component: FunctionDetailComponent,
    data: {
      breadcrumb: '函数详情',
      hasRegion: false
    }
  }
];
@NgModule({
  imports: [
    CommonModule,
    RouterModule.forChild(FC_ROUTES),
    FormsModule,
    ReactiveFormsModule,
    NgZorroAntdModule,
    NgZorroIopModule,
    NgxEchartsModule,
    SharedComponentModule,
    MonacoEditorModule,
    NzPopoverModule,
    NzInputNumberModule,
    ClipboardModule
  ],
  declarations: [
    FunctionListComponent,
    FunctionCreateComponent,
    FunctionDetailComponent,
    FunctionLogComponent,
		FunctionLayerComponent,
    FunctionMonitorComponent,
    FunctionCodeComponent,
    HttpInvokeComponent,
    FunctionTriggerComponent,
    NetConfigComponent,
    AliasCreateComponent,
    AliasDeleteComponent
  ],
  providers: [
    CodeService
  ],
  entryComponents: [AliasCreateComponent, AliasDeleteComponent]
})
export class FunctionModule { }
